/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Ku81
 */
public class ConnectionFactory {
    private static Connection conn;
    public static Connection getConnection() throws ClassNotFoundException, SQLException{
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String conectionUrl = "jdbc:sqlserver://localhost:1433;" +
                                "databaseName=LUDTeamDB;user=sa;password=123456;";
                
        if(conn == null){
            conn = DriverManager.getConnection(conectionUrl);
        }
        return conn;
    }
}
